import java.util.Scanner;
public class EX8_16 {
	public static void main(String args[]) {
		CalendarBean cb = new CalendarBean();
		System.out.println("请输入年份:");
		Scanner reader = new Scanner(System.in);
		int m = reader.nextInt();
		System.out.println("请输入月份:");
		Scanner reader2 = new Scanner(System.in);
                int m2 = reader2.nextInt();
		cb.setYear(m);
		cb.setMonth(m2);
		String [] a = cb.getCalendar();
		char [] str = "日一二三四五六".toCharArray();
		for(char c:str) {
			System.out.printf("%3c",c);
		}
		for(int i=0;i<a.length;i++) {
			if(i%7==0)
				System.out.println("");
			System.out.printf("%4s",a[i]);
		}
	}
}
